<template>
  <ComForm ref="formRef" :format="format"> </ComForm>
  <ComTable ref="tableRef" :column="column"></ComTable>
  <el-button
    style="position: fixed; right: 150px; top: 100px"
    type="info"
    @click="exportTable"
    >导出</el-button
  >
</template>

<script setup>
import { exportXlsx } from "@/utils/common";

let formRef = ref();
let tableRef = ref();

let column = ref([
  { label: "编号", prop: "postId" },
  { label: "任务名称", prop: "postName" },
  { label: "维护单位", prop: "postUnit" },
  { label: "项目负责人", prop: "postPerson" },
  { label: "销号类型", prop: "postType" },
  { label: "销号日期", prop: "postDate" },
  { label: "是否达标", prop: "postPass" },
  { label: "附件", prop: "postFile" },
]);

const format = ref([
  {
    label: "时间",
    prop: "postCode",
    type: "date",
    defaultValue: "",
    span: 5,
  },
  {
    label: "类型",
    prop: "type",
    type: "select",
    option: [
      { label: "日常维护", value: 0 },
      { label: "管网修复", value: 1 },
    ],
    span: 5,
  },
  {
    label: "",
    prop: "",
    type: "button",
    btns: [{ label: "查询", event: "submit", type: "success" }],
    span: 5,
  },
]);

function exportTable() {
  exportXlsx("myTable");
}
</script>
<style scoped>
.form {
  padding: 20px 20px;
}
</style>
